<%@page import="cn.school.entity.Admin"%>
<%@page import="cn.school.service.AdminService"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<%
		request.setCharacterEncoding("utf-8");
		String name = request.getParameter("id");
		String pass = request.getParameter("pass");
	 	AdminService admService = new AdminService();
		Admin adm = admService.login(name, pass);
		if (adm!=null) {
			 session.setAttribute("adminName", name); 
			request.getRequestDispatcher("helloPage.jsp").forward(request, response);
			return;
		}
		response.sendRedirect("login.jsp"); 
	%>

</body>
</html>